#! /usr/bin/env python
# -*- coding:utf-8 -*-
#author:无涯

import  requests

def login():
	r=requests.post(
		url='https://home.51cto.com/index?reback=https%3A%2F%2Fedu.51cto.com%2Fcenter%2Fuser%2Findex%2Flogin-success%3Fsign%3Da0c8BVMJUQNUBwQIVFFTAlABAQBQCAEGUFVRU1ZQTBVASwgaTFwFRkoCBVsQXR9QW10eAQReQwEUTQJZFkpLBB9UV1YXTBNWFhhXVxFAQlZVAFJa&iframe=0&is_go_to_user_set_mobile=1',
		headers={
			"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36",
			"Content-Type":"application/x-www-form-urlencoded",
			"Referer":"https://home.51cto.com/index?reback=https://edu.51cto.com/center/user/index/login-success?sign=a0c8BVMJUQNUBwQIVFFTAlABAQBQCAEGUFVRU1ZQTBVASwgaTFwFRkoCBVsQXR9QW10eAQReQwEUTQJZFkpLBB9UV1YXTBNWFhhXVxFAQlZVAFJa&relogin=1",
			"Cookie":"_uab_collina=164836647051845676070811; from_fr=2; from_course=2; _csrf=b7b3c7fb75782e24fd0c4a1117f884fc02905b02d4be741e3392371ab07d0e06a%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%22pFQGks93rV-dKFaekYHFLDGUNk5fTv7w%22%3B%7D; _ourplusFirstTime=122-3-27-15-34-30; www51cto=B3927E3307EDDEA5D23C3A5E7DD14006stEF; _bl_uid=3blde11q8shyk7uyk41UxX43y58j; Hm_lvt_844390da7774b6a92b34d40f8e16f5ac=1648366471; pub_cookietime=2592000; UM_distinctid=17fca4d2a3d3a-08f6ebf3464123-1c3d645d-13c680-17fca4d2a412f1; sensorsdata2015jssdkcross=%7B%22distinct_id%22%3A%2211217130%22%2C%22first_id%22%3A%2217fca4c465796-0f39de069ad2ca-1c3d645d-1296000-17fca4c4658e2%22%2C%22props%22%3A%7B%22%24latest_traffic_source_type%22%3A%22%E7%9B%B4%E6%8E%A5%E6%B5%81%E9%87%8F%22%2C%22%24latest_search_keyword%22%3A%22%E6%9C%AA%E5%8F%96%E5%88%B0%E5%80%BC_%E7%9B%B4%E6%8E%A5%E6%89%93%E5%BC%80%22%2C%22%24latest_referrer%22%3A%22%22%7D%2C%22%24device_id%22%3A%2217fca4c465796-0f39de069ad2ca-1c3d645d-1296000-17fca4c4658e2%22%7D; PHPSESSID=oshsclu5b18nfdakss056s73o3; once_p=39fb92; pub_wechatopen=aG0wVVNRD1EFAwACVw; reg_sources=edu; ssxmod_itna=QqjxBDyDgG5eq4BPGKHnrIKPhxGr27bo4iKG8UDBuoPiNDnD8x7YDv+mclQZiZbASmvxHIQ2w3PzbSB7bekWpmHEYD84i7DKqibDCqD1D3qDkrQexii9DCeDIDWeDiDG47RpvqzdDHD0Rz+OF1DYPDEj5DRxi8DQH1Dicao4DWpxi1ttHk3IPD0xqwk6oxvCbGDlnvwZPCu=rstjv=rKykRGrsvnHo5fbkDlF0DCFOwoAs9hvOoyyhrQibb5raE14dqB0KYa0eI7ix+iiWErio8AD3Y0wP6H1pp7patYD===; ssxmod_itna2=QqjxBDyDgG5eq4BPGKHnrIKPhxGr27bo4iKG8D8d6WeGXub4GaiQQIkvCr0Ix8gno5uYB2hqHVCW35+OtKAebtPirQPvqLtQm6Kn1d2ZwFHHzGSnuWcratOFCYTTNBfRb92Vu0zQT6PiexBNYnWOiaRWTQvOtBhH=rYF2151epK1EEoFO4PxAgK4ED07KDrbiFqaqQrTA9wdY2STUtE5qD08DYI54D==; acw_tc=2760779416489697187698597ef95319033b93239ae9f5b89268f81cb55c6c; _ourplusReturnCount=3; _ourplusReturnTime=122-4-3-15-8-39; login_from=edu.51cto.com; reg_from=edu.51cto.com; Hm_lpvt_844390da7774b6a92b34d40f8e16f5ac=1648969720"},
		data=
		{"_csrf":"dzRpQVd3emUHcjgGPARDVgViRCUcMRsAHG0hBxszPTA5X1wnAwFNEg==",
		 "LoginForm[username]":"13484545195",
		 "LoginForm[password]":"asd888/==-",
		 "show_qr":"0"})
	return r.cookies

def profile():
	r=requests.get(
		url='https://edu.51cto.com/center/course/lecturer/course',
		cookies=login())
	print(r.status_code)
	print(r.text)

if __name__ == '__main__':
	profile()